package org.example.bean;

/**
 * 对应数据库表结构的实体类，存储国家电影平均评分及电影总数信息
 */
public class MovieCountryAvg {
    // 国家ID，对应数据库表的 country_id 字段，类型为 int
    private int countryId;
    // 该国电影平均评分，对应数据库表的 avg_score 字段，类型为 BigDecimal 便于精确计算
    private double avgScore;
    // 电影总数，对应数据库表的 total_movies 字段，类型为 int
    private int totalMovies;

    public MovieCountryAvg() {
    }

    public MovieCountryAvg(int countryId, double avgScore, int totalMovies) {
        this.countryId = countryId;
        this.avgScore = avgScore;
        this.totalMovies = totalMovies;
    }

    // Getter和Setter方法
    public int getCountryId() {
        return countryId;
    }

    public void setCountryId(int countryId) {
        this.countryId = countryId;
    }

    public double getAvgScore() {
        return avgScore;
    }

    public void setAvgScore(double avgScore) {
        this.avgScore = avgScore;
    }

    public int getTotalMovies() {
        return totalMovies;
    }

    public void setTotalMovies(int totalMovies) {
        this.totalMovies = totalMovies;
    }

    @Override
    public String toString() {
        return "MovieCountryAvg{" +
                "countryId=" + countryId +
                ", avgScore=" + avgScore +
                ", totalMovies=" + totalMovies +
                '}';
    }
}